#pragma once

#include "GrandiaX Mana Egg Table Generator Doc.h"

#include "MagicSlider.h"


// CGrandiaXManaEggSFView view

class CGrandiaXManaEggSFView : public CScrollView, MagicSliderEvents
{
	DECLARE_DYNCREATE(CGrandiaXManaEggSFView)

public:
	CGrandiaXManaEggSFView();           // protected constructor used by dynamic creation
	virtual ~CGrandiaXManaEggSFView();

public:
#ifdef _DEBUG
	virtual void AssertValid() const;
#ifndef _WIN32_WCE
	virtual void Dump(CDumpContext& dc) const;
#endif
#endif

protected:
	virtual void OnDraw(CDC* pDC);      // overridden to draw this view
	virtual void OnInitialUpdate();     // first time after construct

	DECLARE_MESSAGE_MAP()

protected:

    MANAEGG_INTERNAL_DATA ManaEggData;

	CButton TwoStars;
	CButton PAsp;

	CStatic SFFillingRateLabel;
	CMagicSlider SFFillingRate;

	CStatic ToManaEggLabel;

	CComboBox ToManaEgg;

	CStatic MPLabel;
	CMagicSlider MP;

    CStatic SkillBookLabel;
    CStatic SkillBookRankLabel;
    CStatic SkillBookCapLabel;
    CStatic SkillBookCostLabel;

    CStatic SkillBook[7];
    CComboBox SkillBookRank[7];
	CMagicSlider SkillBookCapacity[7];
    CEdit SkillBookCost[7];

    CComboBox Magics[6];
   	CButton SFs[6][7];

    CStatic StarsLabel;
    CComboBox Stars;

    UINT InspectTimer;

public:

	void OnPosChange(CMagicSlider* Slider);

    void UpdateSkillBook();

    void MarkSF(int Magic, unsigned char Sf);
    void WriteSFs();

    void StartInspecting();
    void StopInspecting();

    void OnLiveModifierNotified(MANAEGG_INTERNAL_DATA* Data);

    inline CGrandiaXManaEggTableGeneratorDoc* GetDocument()
    {
        return (CGrandiaXManaEggTableGeneratorDoc*)m_pDocument;
    }

    virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
    afx_msg void OnTimer(UINT_PTR nIDEvent);
    virtual BOOL DestroyWindow();
};


